<div class="editar_paciente">

  <div class="titulo">
    <% if @paciente_logado %>
      Editar Dados
    <% else %>
      Editar Dados do Paciente
    <% end %>
  </div>
  <%= form_tag "atualizar", {:remote => true } do %>
    <%= hidden_field :paciente, :id %>

    <table class="table_dados">
      <tbody>
        <tr>
          <td class="table_label">
            <label>Nome: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :nome %>
            <span id="noiconid_nome" class="noicon" style="display:none"></span>   
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_nome" class="erro_form"></div>
          </td>
        </tr>
        <tr>
          <td class="table_label">
            <label>Sobrenome: </label>
          </td>
          <td class="table_conteudo">
              <%= text_field :paciente, :sobrenome %>
            <span id="noiconid_sobrenome" class="noicon" style="display:none"></span>  
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_sobrenome" class="erro_form"></div>
          </td>
        </tr>    
        <tr>
          <td class="table_label">
            <label>Login: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :login, :disabled => true %>
            <span id="noiconid_login" class="noicon" style="display:none"></span>  
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_login" class="erro_form"></div>
          </td>
        </tr>   
        <% if @paciente_logado %>
          <tr>
            <td class="table_label">
              <label>Senha(*): </label>
            </td>
            <td class="table_conteudo">
              <%= password_field :paciente, :senha %>
              <span id="noiconid_senha" class="noicon" style="display:none"></span> 
            </td>
          </tr>
          <tr>
            <td class="table_info" colspan="2">
              A senha deve possuir pelo menos 6 caracteres.
            </td>
          </tr>
          <tr>
            <td class="table_erro" colspan="2">
              <div id="erro_senha" class="erro_form"></div>
            </td>
          </tr> 
          <tr>
            <td class="table_label">
              <label>Confirmar Senha: </label>
            </td>
            <td class="table_conteudo">
              <%= password_field :paciente, :confirmacao_senha %>
              <span id="noiconid_confirmacao_senha" class="noicon" style="display:none"></span>
            </td>
          </tr>
          <tr>
            <td class="table_erro" colspan="2">
              <div id="erro_confirmacao_senha" class="erro_form"></div>
            </td>
          </tr>  
        <% end %>
        <tr>
          <td class="table_label">
            <label>E-mail: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :email %>
            <span id="noiconid_email" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_email" class="erro_form"></div>
          </td>
        </tr>
        <tr>
          <td class="table_label">
            <label>Idade: </label>
          </td>
          <td class="table_conteudo">
            <%= number_field :paciente, :idade %>
            <span id="noiconid_idade" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_idade" class="erro_form"></div>
          </td>
        </tr>     
        <tr>
          <td class="table_label">
            <label>Sexo: </label>
          </td>
          <td class="table_conteudo">
            <%= select :paciente, :sexo, @paciente_sexos %>
            <span id="noiconid_sexo" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_sexo" class="erro_form"></div>
          </td>
        </tr>   
        <tr>
          <td class="table_label">
            <label>Telefone: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :telefone %>
            <span id="noiconid_telefone" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_telefone" class="erro_form"></div>
          </td>
        </tr> 
        <tr>
          <td class="table_label">
            <label>Endereço: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :endereco %>
            <span id="noiconid_endereco" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_endereco" class="erro_form"></div>
          </td>
        </tr> 
        <tr>
          <td class="table_label">
            <label>Numero: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :numero %>
        	  <span id="noiconid_numero" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_numero" class="erro_form"></div>
          </td>
        </tr>   
        <tr>
          <td class="table_label">
            <label>Complemento: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :complemento %>
        	  <span id="noiconid_complemento" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_complemento" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Cep: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :cep %>
        	  <span id="noiconid_cep" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_cep" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Bairro: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :bairro %>
            <span id="noiconid_bairro" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_bairro" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Estado: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :estado %>
            <span id="noiconid_estado" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_estado" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Cidade: </label>
          </td>
          <td class="table_conteudo">
            <%= text_field :paciente, :cidade %>
            <span id="noiconid_cidade" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_cidade" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Histórico Familiar: </label>
          </td>
          <td class="table_conteudo">
            <%= text_area :paciente, :historico, :rows => 4 %>
            <span id="noiconid_historico" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_historico" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Medicamentos: </label>
          </td>
          <td class="table_conteudo">
            <%= text_area :paciente, :medicamentos, :rows => 4 %>
            <span id="noiconid_medicamentos" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_medicamentos" class="erro_form"></div>
          </td>
        </tr>  
        <tr>
          <td class="table_label">
            <label>Doenças: </label>
          </td>
          <td class="table_conteudo">
            <%= text_area :paciente, :doencas, :rows => 4 %>
            <span id="noiconid_doencas" class="noicon" style="display:none"></span>
          </td>
        </tr>
        <tr>
          <td class="table_erro" colspan="2">
            <div id="erro_doencas" class="erro_form"></div>
          </td>
        </tr> 
      </tbody>
    </table>

    <div class="button">
      <%= submit_tag 'SALVAR', :onclick => "loading()" %>
    </div>  
  <% end %>

</div>
